#!/usr/bin/env bash
#          train   test
#
#         +-  1  -+- 1
#         |
# ucf101 -+-  2  -+- 2
#         |
#         +-  3  -+- 3

ROOT=~/data/YLIMED/mp4_short_encode
TestSplit=$ROOT/YLIMED_short_mp4_EvAll_split_test.txt
ValSplit=$ROOT/YLIMED_short_mp4_EvAll_split_val.txt

if [ $1 == "ylimed" ]
then
    echo "Test of ylimed iframe begin: $(date "+%Y-%m-%d %H:%M:%S")"
    python test.py \
        --gpus 0 \
        --arch resnet152 \
        --data-name ylimed --representation iframe \
        --data-root $ROOT \
        --test-list $TestSplit \
        --weights ylimed_iframe_model_best.pth.tar \
        --save-scores ylimed_best_iframe_model__scores \
        > ylimed_best_iframe_model__scores.out 2>&1
    wait

    echo "Test of ylimed mv begin: $(date "+%Y-%m-%d %H:%M:%S")"
    python test.py \
        --gpus 0 \
        --arch resnet18 \
        --data-name ylimed --representation mv \
        --data-root $ROOT \
        --test-list $TestSplit \
        --weights ylimed_mv_model_best.pth.tar \
        --save-scores ylimed_best_mv_model__scores \
        > ylimed_best_mv_model__scores.out 2>&1
    wait

    echo "Test of ylimed residual begin: $(date "+%Y-%m-%d %H:%M:%S")"
    python test.py \
        --gpus 0 \
        --arch resnet18 \
        --data-name ylimed --representation residual \
        --data-root $ROOT \
        --test-list $TestSplit \
        --weights ylimed_residual_model_best.pth.tar \
        --save-scores ylimed_best_residual_model__scores \
        > ylimed_best_residual_model__scores.out 2>&1
    wait
    echo "Test of ylimed residual end: $(date "+%Y-%m-%d %H:%M:%S")"

elif [ $1 == "dev" ]
then
    echo "dev"
    python test.py \
        --gpus 2 \
        --arch resnet152 \
        --data-name ylimed --representation iframe \
        --data-root $ROOT \
        --test-list $ValSplit \
        --weights ./out/ylimed_finetuning01/weights/ylimed_iframe_model_best.pth.tar \
        --save-scores ylimed_best_iframe_model__scores_deeev
    wait
else
    echo "Please make sure the positon variable is dev/ylimed."
fi
# wait
# # ucf101 Iframe
# nohup python test.py \
#     --gpus 0 \
#     --arch resnet152 \
#     --data-name ucf101 --representation iframe \
#     --data-root data/ucf101/mpeg4_videos \
#     --test-list data/datalists/ucf101_split3_test.txt \
#     --weights weights/ucf101_iframe3_model_iframe_model_best.pth.tar \
#     --save-scores ucf101_best_iframe_model__scores3 \
#     > ucf101_best_iframe_model__scores3.out 2>&1 &
#
# wait
#
# # ucf101 motion vector model.
# nohup python test.py \
#     --gpus 0 \
#     --arch resnet18 \
#     --data-name ucf101 --representation mv \
#     --data-root data/ucf101/mpeg4_videos \
#     --test-list data/datalists/ucf101_split3_test.txt \
#     --weights weights/ucf101_mv3_model_mv_model_best.pth.tar \
#     --save-scores ucf101_best_mv_model__scores3 \
#     > ucf101_best_mv_model__scores3.out 2>&1 &
#
# wait
#
# # ucf101 residual model.
# nohup python test.py \
#     --gpus 0 \
#     --arch resnet18 \
#     --data-name ucf101 --representation residual \
#     --data-root data/ucf101/mpeg4_videos \
#     --test-list data/datalists/ucf101_split3_test.txt \
#     --weights weights/ucf101_residual3_model_residual_model_best.pth.tar \
#     --save-scores ucf101_best_residual_model__scores3 \
#     > ucf101_best_residual_model__scores3.out 2>&1 &
# wait
#
# # hmdb51 Iframe
# nohup python test.py \
#     --gpus 0 \
#     --arch resnet152 \
#     --data-name hmdb51 --representation iframe \
#     --data-root data/hmdb51/mpeg4_videos \
#     --test-list data/datalists/hmdb51_split3_test.txt \
#     --weights weights/hmdb51_iframe3_model_iframe_model_best.pth.tar \
#     --save-scores hmdb51_best_iframe_model__scores3 \
#     > hmdb51_best_iframe_model__scores3.out 2>&1 &
# wait
#
# # hmdb51 motion vector model.
# nohup python test.py \
#     --gpus 0 \
#     --arch resnet18 \
#     --data-name hmdb51 --representation mv \
#     --data-root data/hmdb51/mpeg4_videos \
#     --test-list data/datalists/hmdb51_split3_test.txt \
#     --weights weights/hmdb51_mv3_model_mv_model_best.pth.tar \
#     --save-scores hmdb51_best_mv_model__scores3 \
#     > hmdb51_best_mv_model__scores3.out 2>&1 &
#
# wait
#
# # hmdb51 residual model.
# nohup python test.py \
#     --gpus 0 \
#     --arch resnet18 \
#     --data-name hmdb51 --representation residual \
#     --data-root data/hmdb51/mpeg4_videos \
#     --test-list data/datalists/hmdb51_split3_test.txt \
#     --weights weights/hmdb51_residual3_model_residual_model_best.pth.tar \
#     --save-scores hmdb51_best_residual_model__scores3 \
#     > hmdb51_best_residual_model__scores3.out 2>&1 &
#
